<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>2-4 属性选择器之一</title>
    <style>
        [src] {
            height: 200px;
        }

        /*不生效,属性当且唯一等于时生效*/
        [title=male] {
            background-color: #f0e62f;
        }

        /*生效*/
        [alt=female] {
            background-color: #f0e62f;
        }

        /*生效，属性中包含时生效*/
        [title~=t1] {
            border: 2px solid blue;
        }
    </style>
</head>
<body>
<img src="images/male.png" title="t1 male" alt="male"/>
<img src="images/female.png" title="t1 female" alt="female"/>
</body>
</html>
